package jm.nj.demo13mian.demo4;
/*
* 设置线程的名称:
* 1.void setName (String name)   改变线程名称,使之与参数name相同
* 2.Thread(String name)  构造方法传递线程名称  ,把名称传递给Therad类的构造方法,让Thread类给线程起名字
* */
public class MyThread extends Thread{
    public MyThread() {
    }

    public MyThread(String name) {
        super(name);
    }

    @Override
    public void run() {
        System.out.println(Thread.currentThread().getName());
    }
}
